package com.ddwl.message;

import com.ddwl.message.service.WsMsgService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2019/8/8 14:05
 */
@SpringBootApplication
@EnableDiscoveryClient
@ComponentScan("com.ddwl")
@MapperScan(basePackages = {"com.ddwl.message.mapper", "com.ddwl.message.domain.*.dao.mapper"})
@EnableFeignClients(basePackages = {"com.ddwl.common.feign.api", "com.ddwl.common.feign.thirdparty", "com.ddwl.common.feign.wx"})
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@EnableAsync
public class MessageApplication {
    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(MessageApplication.class);
        ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
        //解决WebSocket不能注入的问题
        WsMsgService.setApplicationContext(configurableApplicationContext);
    }
}
